using System;
using System.Collections.Generic;
using System.Text;
using ERP.BusinessEntities.Base;
using ERP.DAL.Factory;
using System.Data;
namespace ERP.BusinessEntities
{

	public class ICProductUOMsController:BaseBusinessController
	{
		public ICProductUOMsController()
		{
			dal = FactoryDal.CreateEndDal("ICProductUOMs");
		}

        public ICProductUOMsInfo GetObject(int iProductID, int iStockUOMID)
        {
            String strQuery = String.Format(@"SELECT * FROM ICProductUOMs
                                                WHERE FK_ICProducts_ID = {0}
                                                AND FK_ICStockUOMs_ID = {1}", iProductID, iStockUOMID);

            DataSet ds = GetDataset(strQuery);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                return (ICProductUOMsInfo)GetObjectFromDataRow(ds.Tables[0].Rows[0]);

            return null;
        }
	}
}
